import { request } from "@/untils";

export function getChannelsAPI() {
    return request({
        url: '/channels',
        method: 'GET',
    })
}

export function createArticleAPI(data) {
    return request({
        url: '/mp/articles?draft=false',
        method: 'POST',
        data
    })
}

export function getArticleListAPI(params) {
    return request({
        url: '/mp/articles',
        method: 'GET',
        params
    })
}

export function deleAricleList(data) {
    return request({
        url: `/mp/articles/${data.id}`,
        method: 'DELETE'
    })
}

export function getArticleDetail(id) {
    return request({
        url: `/mp/articles/${id}`
    })
}

export function updateArticleAPI(data, articleId) {
    return request({
        url: `/mp/articles/${articleId}?draft=false`,
        method: 'PUT',
        data
    })
}